/*
 * jQuery Bookmarklet - version 0.5
 * Written By: Brett Barros
 *
 * If you use this script, please link back to the source
 *
 * Copyright (c) 2010 Latent Motion (http://latentmotion.com/how-to-create-a-jquery-bookmarklet/)
 * Released under the Creative Commons Attribution 3.0 Unported License,
 * as defined here: http://creativecommons.org/licenses/by/3.0/
 *
 */

var path="http://opmv.googlecode.com/svn/trunk/js";	
 
// Where can we get jQuery?
var jqPath=path+"/jquery/jquery-1.3.2.js";

// Where is your CSS? Add versioning to prevent caching problems
//var myCSS = "http://tablesorter.com/themes/blue/style.css";

// What are your other required scripts (ie: jquery plugins)?
var js =[
   	path+"/jquery/dist/js/jquery.rdfquery.core-1.0.js",
	path+"/jquery/dist/js/jquery.rdfquery.rdfa-1.0.js",
	path+"/jquery/dist/js/jquery.rdfquery.rules-1.0.js",
	path+"/jquery/jquery.json-2.2.min.js",
	path+"/Jit/jit.js",  
        path+"/binaryajax.js",
	path+"/exif.js",
	path+"/opmv.js"
  //  Note: You can include any number of scripts
	];

// This function will be called after loading jQuery
function jqReady(){

	// This function will be called after loading all of your scripts
	function jqCustom(){
		
		// You can add the stylesheet of our choice
		//$(document.createElement('link') ).attr({href: myCSS,rel: 'stylesheet'}).appendTo('head');

		// Initiate table sorter
		//$("table").tablesorter().addClass("tablesorter"); 
		
		
		OPM.opm_start()

	}

	// If needed, load and wait for dependency scripts
	var b=js.length;if(b!==0){var c=1,d=function(){c++==b&&jqCustom()};for(var e in js)$.getScript(js[e],d)}else jqCustom()

}

// Guts to load jQuery dynamically -> http://ow.ly/1tcA2
z=function(){z.getScript(jqPath);z.tryReady(0)};z.getScript=function(a){var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("src",a);typeof b!="undefined"&&document.getElementsByTagName("head")[0].appendChild(b)};
z.tryReady=function(a){if(typeof $=="undefined")a<=5E3?setTimeout("z.tryReady("+(a+200)+")",200):alert("Timed out while calling jQuery.");else jqReady()};z();